﻿#region ... Copyright Notice ...
/*
   Copyright 2008 Tyler Jensen

	Author: Tyler Jensen    http://www.tsjensen.com/blog

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Atrax.Logging
{
	public static class LogEvents
	{
		public const string EmailerSendNotificationFailed = "401";
		public const string EmailerSendEmailAsynchFailed = "403";

		public const string WordStripperStripToParagraphsFailed = "501";

		public const string SpiderWrapperDoRequestFailed = "601";
		public const string SpiderWrapperKillAllQuerysFailed = "603";

		public const string SpiderCallbackException = "701";
		public const string SpiderQueryUnhandled = "703";

		public const string QueryRestartedByCallbackProcessor = "801";
		public const string QueryNotFoundByCallbackProcessor = "803";
		public const string QueryExceededProcessingAttemptsRemovedByCallbackProcessor = "805";
		public const string QueryRecallFailedInCallbackProcessor = "807";
		public const string CallbackProcessorFailed = "809";

		public const string PersistenceManagerLoadQuerysFailed = "813";
		public const string PersistenceManagerRemoveFailed = "815";
		public const string PersistenceManagerLoadQueryFromFileFailed = "817";
		public const string PersistenceManagerSaveQueryFailed = "819";

		public const string RequestControllerEnqueueRequestFailed = "821";
		public const string RequestControllerCompletedQueryFailed = "823";
		public const string RequestControllerChangeQueryPriorityQueryFailed = "825";
		public const string RequestControllerExpiredQuery = "827";
		public const string RequestControllerManageWorkInProgressFailed = "829";
		public const string RequestControllerPingNearlyExpiredFailed = "8291";

		public const string CallbackSenderSucceeded = "830";  //successes are even numbered
		public const string CallbackSenderFailed = "831";

		public const string SpiderCallbackReceived = "840";

		public const string RequestHandlerFailed = "851";

		public const string PageMetricsRequested = "902";
		public const string OvertureVolumeRequested = "904";
		public const string MsnSerpRequested = "906";
		
		public const string YahooWebSearchRequested = "9102";
		public const string YahooRelatedSuggestionsRequested = "9104";
		public const string YahooPageDataRequested = "9106";
		public const string YahooInboundLinksRequested = "9108";

		public const string GooglePageRankRequested = "912";
		public const string GoogleBacklinksRequested = "914";
		public const string GoogleSerpRequested = "916";

		public const string ContentAnalysisRequested = "918";

		public const string AlexaWebSearchRequested = "922";
		public const string AlexaCrawlRequested = "924";
		public const string AlexaSitesLinkingInRequested = "926";
		public const string AlexaTrafficHistoryRequested = "928";
		public const string AlexaCategoryListingsRequested = "930";
		public const string AlexaCategoryBrowseRequested = "932";
		public const string AlexaUrlInfoRequested = "934";

		public const string CompetitiveMetricsRequested = "944";

		public const string RequestHandlerProcessRequestFailure = "901";
		public const string RequestHandlerProcessCallbackFailure = "903";
		public const string RequestHandlerQueryComplete = "900";
		public const string RequestHandlerQueryCompletionException = "905";
		public const string RequestHandlerProcessPingFailed = "907";

		public static string GetEventIdDescription(string eventId)
		{
			switch (eventId)
			{
				case LogEvents.SpiderCallbackException: return "SpiderCallbackException";
				case LogEvents.SpiderQueryUnhandled: return "SpiderQueryUnhandled";
																										 
				case LogEvents.QueryRestartedByCallbackProcessor: return "QueryRestartedByCallbackProcessor";
				case LogEvents.QueryNotFoundByCallbackProcessor: return "QueryNotFoundByCallbackProcessor";
				case LogEvents.QueryExceededProcessingAttemptsRemovedByCallbackProcessor: return "QueryExceededProcessingAttemptsRemovedByCallbackProcessor";
				case LogEvents.QueryRecallFailedInCallbackProcessor: return "QueryRecallFailedInCallbackProcessor";
				case LogEvents.CallbackProcessorFailed: return "CallbackProcessorFailed";
																														 
				case LogEvents.PersistenceManagerLoadQuerysFailed: return "PersistenceManagerLoadQuerysFailed";
				case LogEvents.PersistenceManagerRemoveFailed: return "PersistenceManagerRemoveFailed";
				case LogEvents.PersistenceManagerLoadQueryFromFileFailed: return "PersistenceManagerLoadQueryFromFileFailed";
				case LogEvents.PersistenceManagerSaveQueryFailed: return "PersistenceManagerSaveQueryFailed";
																														 
				case LogEvents.RequestControllerEnqueueRequestFailed: return "RequestControllerEnqueueRequestFailed";
				case LogEvents.RequestControllerCompletedQueryFailed: return "RequestControllerCompletedQueryFailed";
				case LogEvents.RequestControllerChangeQueryPriorityQueryFailed: return "RequestControllerChangeQueryPriorityQueryFailed";
				case LogEvents.RequestControllerExpiredQuery: return "RequestControllerExpiredQuery";
				case LogEvents.RequestControllerManageWorkInProgressFailed: return "RequestControllerManageWorkInProgressFailed";
				case LogEvents.RequestControllerPingNearlyExpiredFailed: return "RequestControllerPingNearlyExpiredFailed";
																														 
				case LogEvents.CallbackSenderSucceeded: return "CallbackSenderSucceeded";
				case LogEvents.CallbackSenderFailed: return "CallbackSenderFailed";
																														 
				case LogEvents.SpiderCallbackReceived: return "SpiderCallbackReceived";
																														 
				case LogEvents.RequestHandlerFailed: return "RequestHandlerFailed";
																														 
				case LogEvents.PageMetricsRequested: return "PageMetricsRequested";
				case LogEvents.OvertureVolumeRequested: return "OvertureVolumeRequested";
				case LogEvents.MsnSerpRequested: return "MsnSerpRequested";

				case LogEvents.YahooWebSearchRequested: return "YahooWebSearchRequested";
				case LogEvents.YahooRelatedSuggestionsRequested: return "YahooRelatedSuggestionsRequested";
				case LogEvents.YahooPageDataRequested: return "YahooPageDataRequested";
				case LogEvents.YahooInboundLinksRequested: return "YahooInboundLinksRequested";
																														 
				case LogEvents.GooglePageRankRequested: return "GooglePageRankRequested";
				case LogEvents.GoogleBacklinksRequested: return "GoogleBacklinksRequested";
				case LogEvents.GoogleSerpRequested: return "GoogleSerpRequested";
																														 
				case LogEvents.AlexaWebSearchRequested: return "AlexaWebSearchRequested";
				case LogEvents.AlexaCrawlRequested: return "AlexaCrawlRequested";
				case LogEvents.AlexaSitesLinkingInRequested: return "AlexaSitesLinkingInRequested";
				case LogEvents.AlexaTrafficHistoryRequested: return "AlexaTrafficHistoryRequested";
				case LogEvents.AlexaCategoryListingsRequested: return "AlexaCategoryListingsRequested";
				case LogEvents.AlexaCategoryBrowseRequested: return "AlexaCategoryBrowseRequested";
				case LogEvents.AlexaUrlInfoRequested: return "AlexaUrlInfoRequested";

				case LogEvents.RequestHandlerProcessRequestFailure: return "RequestHandlerProcessRequestFailure";
				case LogEvents.RequestHandlerProcessCallbackFailure: return "RequestHandlerProcessCallbackFailure";
				case LogEvents.RequestHandlerQueryComplete: return "RequestHandlerQueryComplete";
				case LogEvents.RequestHandlerQueryCompletionException: return "RequestHandlerQueryCompletionException";
				case LogEvents.RequestHandlerProcessPingFailed: return "RequestHandlerProcessPingFailed";

				case LogEvents.SpiderWrapperDoRequestFailed: return "SpiderWrapperDoRequestFailed";
				case LogEvents.SpiderWrapperKillAllQuerysFailed: return "SpiderWrapperKillAllQuerysFailed";

				case LogEvents.WordStripperStripToParagraphsFailed: return "WordStripperStripToParagraphsFailed";

				case LogEvents.EmailerSendNotificationFailed: return "EmailerSendNotificationFailed";
				case LogEvents.EmailerSendEmailAsynchFailed: return "EmailerSendEmailAsynchFailed";

				case LogEvents.CompetitiveMetricsRequested: return "CompetitiveMetricsRequested";

				case LogEvents.ContentAnalysisRequested: return "ContentAnalysisRequested";

				default: return "Unknown";
			}
		}
		
	}
}
